#ifndef _EDGE_SHIFTER_H_
#define _EDGE_SHIFTER_H_

#include "../edgewatcher/EdgeWatcher.h"
#include "../shifter/Shifter.h"

/*
	class : EdgeShifter
	desc : Runs a shifter by detecting an edge.
*/
class EdgeShifter : public Device
{
	private:
		//shifter run
		Shifter shifter;
		//edge detector
		EdgeWatcher watcher;
		//tells me which signal to watch for. 
		unsigned char sampleChoice;
	public :
		//default constructor.
		EdgeShifter();
		//constructor takes in pointerToWatch and a pointer to shift
		//values to, the shiftTrigger is the choice for sample,
		//size is the size of the shifter dir is direction and i
		// is the input direction.
		EdgeShifter(BitPointer& pointerToWatch,
			    BitPointer& shiftPointer, 
			unsigned char shiftTrigger,
			unsigned int size,
			bool dir,
			bool i);
		//gets a BitArray from the shifter
		BitArray get();
		//sets the bit array of the shifter.
		void set(BitArray& array);
		//returns if the shifter is finished shifting.
		bool finished();
		//runs the edge shifter.
		virtual void run();

		
};


#endif
